<?php
/**
 * Created by PhpStorm.
 * User: mojie126
 * Date: 2017/8/22 0022
 * Time: 下午 16:22
 */

namespace app\common;

use PHPQRCode\QRcode;

class qr
{
	static public function qrcode($content, $level = 2, $size = 3)
	{
		ob_start();
		QRcode::png($content, FALSE, $level, $size, 1);
		$imageString = base64_encode(ob_get_contents());
		ob_clean();

		return "data:image/png;base64," . $imageString;
	}
}